package common;

import java.lang.management.ManagementFactory;

/**
 * program: io-share 
 * author: bsworld.xie 
 * create: 2021-04-14 11:31 
 * description: 
 */
public class ProcessUtil {
    public static int getPid() {
        // get name representing the running Java virtual machine.
        String name = ManagementFactory.getRuntimeMXBean().getName();
        System.out.println(name);
        String pid = name.split("@")[0];
        return Integer.valueOf(pid);
    }
}
